﻿namespace PageAdmin.Utils
{

    /// <summary>
    /// 图片水印配置类
    /// </summary>
    public class WaterMarkSetting
    {
        private int _Quality=8;
        private int _Posiotion = 9;
        private int _Alpha=2;


        /// <summary>
        /// 需要加水印的图片路径
        /// </summary>
        public  string ImagePath { get; set; }

        /// <summary>
        /// 图片质量，1-10之间整数，默认8
        /// </summary>
        public int Quality
        {
            get
            {
                return _Quality;
            }
            set
            {
                _Quality = value;
                if (_Quality > 10 || _Quality <= 0)
                {
                    _Quality = 8;
                }
            }
        }

        /// <summary>
        /// 图片位置，1到9位置，对应9宫格
        /// </summary>
        public int Posiotion
        {
            get
            {
                return _Posiotion;
            }
            set
            {
                _Posiotion = value;
                if (_Posiotion > 9 ||  _Posiotion <= 1)
                {
                    _Posiotion = 9;
                }
            }
        }

        /// <summary>
        /// 透明度，1-10之前的数字，默认为2
        /// </summary>
        public int Alpha
        {
            get
            {
                return _Alpha;
            }
            set
            {
                _Alpha = value;
                if (_Alpha > 10 && _Alpha <=0)
                {
                    _Alpha= 2;
                }
            }
        }
        
        /// <summary>
        /// 水印图片的路径，建议用透明png图片作为水印图片
        /// </summary>
        public string WatermarkPath { get; set;}

    }
}